<?php
namespace app\home\model;
use think\Model;
use think\Db;
class SpecialsModel extends Model
{
    public function __construct()
    {
        parent::__construct();
    }

    //首页推荐商品数据
    public function getSpecials(){
        $specials = Db::table('goods')
            ->alias('g')
            ->join('goods_info in','g.id = in.goods_id AND g.is_del = 0 AND g.is_push =1 AND in.is_del =0')
            ->field('g.*,in.goods_describe')
            ->order("g.create_time desc")
            ->select();
//        echo $this->getLastSql();
//        exit;

//         echo "<pre>";
//        dump($specials);
        return $specials;
    }
}